<%@page import="java.util.HashMap"%>
<%@page import="domain.Member"%>
<%@page import="java.util.ArrayList"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
ArrayList list = new ArrayList();
list.add("one");//String
list.add(30);//얘는 그냥 인트가 아니고 Intiger
list.add(new Member("id-id","wds","이철수","chsms@naver.com"));
session.setAttribute("list", list);
%>

<%
	String [] names ={"김철수", "박영수", "이영희", "최순이"};
	int [] ages = {20,30,40};
	request.setAttribute("ages", ages);
	request.setAttribute("names", names);
%>
<%
	HashMap map = new HashMap();
	map.put("name", "tv");
	map.put("maker","LG");
	map.put("price", 200000);
	request.setAttribute("product", map);
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2>EL을 이용해 collection의 값들 출력</h2>
<h3>배열</h3>
${names[0] },${requestScope.names[1] },${requestScope.names[2] },${requestScope.names[3] }<br>
${requestScope.ages[0]},${requestScope.ages[1] },${requestScope.ages[2] }
<h3>List</h3>
${sessionScope.list[0] }, ${sessionScope.list[1] }<br>${sessionScope.list[2] }<br>
${sessionScope.list[2].id} - ${sessionScope.list[2].password }-${sessionScope.list[2].name }-${sessionScope.list[2].email }</body>
<h3>MAP</h3>
${requestScope.product.name },${requestScope.product.maker }
<!-- 위처럼 쓸수도 있고 아래처럼 쓸 수도 있고 -->
${requestScope.product["name"] }
</html>